#ifndef __APP_BUFFER_H__
#define __APP_BUFFER_H__
#include "app_common.h"
#include "stdint.h"//uint8_t
#include "pthread.h"
#include "log/log.h"
#include "string.h"
#include "stdlib.h" //内存分配
//此举是为了封装.防止用户修改结构体
typedef  void * buffer_handle_t;

buffer_handle_t app_buffer_init(int capacity);
void app_buffer_deinit(buffer_handle_t buffer_handle);
Com_State app_buffer_write(buffer_handle_t buffer_handle, char *data, int data_len);
int app_buffer_read(buffer_handle_t buffer_handle, char *read_data, int buff_len);
#endif /* __APP_BUFFER_H__ */